//
//  LoadDataViewController.m
//  网易公开课项目
//
//  Created by 林 艺 on 13-11-11.
//  Copyright (c) 2013年 Marklin. All rights reserved.
//

#import "LoadDataViewController.h"
#import "ASIHTTPRequest.h"
#import "CourseModel.h"
#import "MainViewController.h"
#import "LoadCourseDataManager.h"

@interface LoadDataViewController ()

@end

@implementation LoadDataViewController

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(turnToMainView:) name:kTurnToMainViewNotification object:nil];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
//    self.wantsFullScreenLayout = YES;
    self.navigationController.navigationBarHidden = YES;
    UIImageView *backgroundImageview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    backgroundImageview.image = [UIImage imageNamed:@"Default.png"];
    [self.view addSubview:backgroundImageview];
    LoadCourseDataManager *dataManger = [LoadCourseDataManager shareInstance];
    [dataManger loadDataFromInternet];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)turnToMainView:(NSNotification *)note;
{
    MainViewController *mainView = [[MainViewController alloc] init];
    [self presentViewController:mainView animated:NO completion:nil];
}



@end
